package com.heima.article.job;

import com.heima.article.service.ApArticleService;
import com.heima.common.dtos.Result;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ComputeHotArticleJob {
    @Autowired
    private ApArticleService apArticleService;
    @XxlJob("computeHotArticleJob")
    public ReturnT<String> hanle(String param){
        log.info("热文章分值计算调度任务开始执行....");
        apArticleService.saveToRedis();
        log.info("热文章分值计算调度任务开始执行....");
        return ReturnT.SUCCESS;
    }
}
